% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/frs_drop_inactive.R
\name{frs_drop_inactive}
\alias{frs_drop_inactive}
\title{Remove inactive sites from downloaded FRS data.table}
\usage{
frs_drop_inactive(frs, closedid)
}
\arguments{
\item{frs}{Required, data.table from frs_get()}

\item{closedid}{Required, vector of codes to treat as inactive,
obtained from \code{\link[=frs_inactive_ids]{frs_inactive_ids()}} which downloads national dataset and
uses assumed codes and returns ids of the inactive sites.}
}
\value{
Returns the full frs data.table but without the inactive ids
}
\description{
Remove inactive sites from downloaded FRS data.table
}
\details{
For the late 2023 version,
\itemize{
\item Complete list of unique ids is 4,775,797 out of 7,558,760 rows of data.
\item Count of all REGISTRY_ID rows:   7,558,760
\item Count of unique REGISTRY_ID values: 4,775,797
\item Clearly inactive unique IDs:     1,511,111
\item Assumed active unique IDs:       3,264,686
}

\strong{The definitions of active/inactive here are not quite the same as used in ECHO, as of late 2023.}

See \url{https://echo.epa.gov/help/facility-search/search-criteria-help#facchar}

Codes assumed to mean site is closed:
\itemize{
\item CLOSED
\item PERMANENTLY CLOSED
\item PERMANENTLY SHUTDOWN
\item INACTIVE
\item TERMINATED
\item N
\item RETIRED
\item OUT OF SERVICE – WILL NOT BE RETURNED
\item CANCELED, POSTPONED, OR NO LONGER PLANNED
}
}
\examples{
 
  # frs <- frs_get()
  # closedid <- frs_inactive_ids()
  # frs <- frs_drop_inactive(frs, closedid = closedid)
  # usethis::use_data(frs, overwrite = TRUE)
}
\seealso{
\code{\link[=frs_update_datasets]{frs_update_datasets()}} which uses \code{\link[=frs_get]{frs_get()}} and \code{\link[=frs_inactive_ids]{frs_inactive_ids()}} \code{\link[=frs_active_ids]{frs_active_ids()}}
}
